package com.k.kppcloud.provider.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class HelloController {
    @Value("${spring.application.name}")
    private String serverName;
    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/api/sayHelloParams")
    @ResponseBody
    public String sayHelloParams(@RequestBody List<String> userNameList) {
        return "im provider sayHelloParams";
    }

    @RequestMapping("/api/sayHello")
    @ResponseBody
    public String sayHelloParams() {
        System.out.println("name:"+serverName+" port:"+serverPort);
        return "im provider sayHello name:"+serverName +" port:"+serverPort;
    }
}
